home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
utils
/
ted
/
tedtro1.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-10-02
|
5KB
|
165 lines
{
Coding & Editing by :
█▀▀▀▀▀▀█ █▀▀▀▀▀▀█ █▀▀▀▀▀▀█ █▀▀▀▀▀▀█ █▀▀▀▀▀█ █ █▀▀▀▀▀▀▀ █▀▀▀▀▀▀▀
█▀▀▀▀▀▀▀ █▀▀▀▀▀▀█ █▀▀▀▀▀█▀ █▀▀▀▀▀▀█ █ █ █ ▀▀▀▀▀▀▀█ █▀▀▀▀▀
█ █ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █▄▄▄▄▄█ █ ▄▄▄▄▄▄▄█ █▄▄▄▄▄▄▄
Programmed by Marcin Jaskowiak, aka Paradise, Lublin, Poland,
in Turbo Pascal 7.0.
This is FUQNWARE - if u like it, u must register it by sending
some money (u tell how much) to ME:) if not - u choose.
Read TED.DOC 4 more info.
Snail mail: Email:
Marcin Jaskowiak liksay@bachus.umcs.lublin.pl
Flat 114, 3 Zarnowiecka Str.
20-630 Lublin
Poland
Presents :
TED font editor SCROLLERS PACK 94
with :
EXAMPLE NR 1
}
PROGRAM TED_INTRO_NR1;
USES DOS,CRT;
VAR
PALETTE : ARRAY [0..255,1..3] OF BYTE;
CHARS : ARRAY [' '..']'] OF POINTER;
CHARSDATA : ARRAY [' '..']',1..3] OF BYTE;
F : FILE;
B,ROW,COL : BYTE;
X,Y,I : INTEGER;
CH,K : CHAR;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE INITVGA; ASSEMBLER; { INITIALIZE VGA CARD MODE 13H }
ASM
MOV AX,0013H
INT 10H
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE CLOSEVGA; ASSEMBLER; { CLOSE VGA MODE AND SET TEXT }
ASM
MOV AX,0003H
INT 10H
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE SETCOLOR(NR,R,G,B: BYTE); ASSEMBLER; { SET RGB VAL TO COLOR NR }
ASM
MOV DX,3C8H
MOV AL,NR
OUT DX,AL
INC DX
MOV AL,R
OUT DX,AL
MOV AL,G
OUT DX,AL
MOV AL,B
OUT DX,AL
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE PUTPIX(X,Y : INTEGER; C: BYTE); ASSEMBLER; { PLOT PIXEL AT (X,Y) }
ASM
MOV AX, 0A000H
MOV ES, AX
MOV AX, 320
MUL Y
ADD AX, X
MOV DI, AX
MOV AL, C
STOSB
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE LOADPAL(NAME: STRING); { LOAD .PAL FILE AND SET PALETTE }
BEGIN
ASSIGN(F,NAME+'.PAL');
RESET(F,1);
BLOCKREAD(F,PALETTE,768);
CLOSE(F);
FOR B:=0 TO 255 DO SETCOLOR(B,PALETTE[B,1],PALETTE[B,2],PALETTE[B,3]);
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE LOADTED(NAME: STRING); { LOAD .TED FILE TO MEMORY }
VAR TX,TY: BYTE; CH: CHAR;
BEGIN
ASSIGN(F,NAME+'.TED');
RESET(F,1);
SEEK(F,20);
WHILE NOT(EOF(F)) DO
BEGIN
BLOCKREAD(F,CH,1);
BLOCKREAD(F,TX,1);
BLOCKREAD(F,TY,1);
GETMEM(CHARS[CH],TX*TY);
CHARSDATA[CH,1]:=TX; CHARSDATA[CH,2]:=TY; CHARSDATA[CH,3]:=1;
BLOCKREAD(F,CHARS[CH]^,TX*TY);
END;
CLOSE(F);
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE DONETED; { DEALLOCATE FONT MEMORY }
VAR CH: CHAR;
BEGIN
FOR CH:=' ' TO ']' DO
BEGIN
IF CHARSDATA[CH,3]=1 THEN
BEGIN
FREEMEM(CHARS[CH],CHARSDATA[CH,1]*CHARSDATA[CH,2]);
CHARSDATA[CH,3]:=0;
END;
END;
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE PUTIT(X,Y: INTEGER; CH: CHAR); { DRAW ONE CHAR }
VAR XR,YR,AX,AY: BYTE;
BEGIN
XR:=CHARSDATA[CH,1];
YR:=CHARSDATA[CH,2];
FOR AY:=1 TO YR DO
FOR AX:=1 TO XR DO
BEGIN
B:=MEM[SEG(CHARS[CH]^):OFS(CHARS[CH]^)+(AY-1)*XR+AX-1];
IF B>0 THEN PUTPIX(X+AX-1,Y+AY-1,B);
END;
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE WRITEXY(X,Y: INTEGER; S: STRING); { WRITE A STRING ON SCREEN }
VAR ABSX,ABSY: INTEGER; NR: BYTE;
BEGIN
ABSX:=X; ABSY:=Y;
FOR NR:=1 TO LENGTH(S) DO
IF S[NR] IN [' '..']'] THEN
BEGIN
IF S[NR]=' ' THEN INC(ABSX,CHARSDATA[S[NR+1],1]+1)
ELSE BEGIN
PUTIT(ABSX,ABSY,S[NR]);
INC(ABSX,CHARSDATA[S[NR],1]+1);
END;
END;
END;
{───────────────────────────────────────────────────────────────────────────}
BEGIN
INITVGA;
LOADPAL('FONT018');
LOADTED('FONT018');
WRITEXY(0,0, 'WADDA FUQ IS THAT?');
WRITEXY(0,30, 'ITS ONLY SMALL');
WRITEXY(0,60, 'EXAMPLE HOW TO');
WRITEXY(0,90, 'SHOW CHARS ON');
WRITEXY(0,120,'THE SCREEN');
READKEY;
DONETED;
CLOSEVGA;
END.